$(function () {
    $('.icon-liebiao').on('click', () => {
        $('.zz').show()
        $('.menu-list').removeClass('out')
        $('.menu-list').addClass('in')
    })
    $('.icon-guanbi').on('click', () => {
        $('.zz').hide()
        $('.menu-list').removeClass('in')
        $('.menu-list').addClass('out')
    })
    $('.more').on('click', () => {
        console.log('more')
    })
    var mySwiper = new Swiper('.swiper-container', {
        loop: true, // 循环模式选项
        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },
        on: {
            slideChangeTransitionStart: function() {
                //获取当前活动的轮播图添加动画
                const moveList = $(this.slides[this.activeIndex]).children('div').children()
                moveAnimation(moveList)
                //移除其他轮播图的动画效果
                const otherList = $(this.slides[this.activeIndex]).siblings().children('div').children()
                otherList.each(function(index,ele){
                    $(this).removeClass('animated ' + $(this).data('animation')).css('visibility', 'hidden')
                })
                // $this.addClass('animated ' + $this.data('animation')).css('visibility','visible')
            }
        }

        // 如果需要前进后退按钮
        //   navigation: {
        //     nextEl: '.swiper-button-next',
        //     prevEl: '.swiper-button-prev',
        //   },

        // 如果需要滚动条
        //   scrollbar: {
        //     el: '.swiper-scrollbar',
        //   },
    })
    //定义移动函数
    function moveAnimation(eleList) {
        eleList.each(function (index, ele) {
            const $this = $(this)
                if ($this.data('timeout')) {
                    window.setTimeout(function () {
                        $this.addClass('animated ' + $this.data('animation')).css('visibility', 'visible')
                    }, parseInt($this.data('timeout'), 10));
                }
                else {
                    $this.addClass('animated ' + $this.data('animation'))
                }
        })
    }

})